package com.mzjf.boot.service;
import com.github.pagehelper.PageHelper;
import com.mzjf.boot.common.PageVo;
import com.mzjf.boot.dao.SysuserMapper;
import com.mzjf.boot.entity.Sysuser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private SysuserMapper sysuserMapper; //用户接口
    /**
     *
     * @Title: getList
     * @Description: 从数据库中获取所有商品类型列表
     * @param pageNum 当前页
     * @param pageSize 当前页面展示数目
     * @return
     * @throws Exception
     */
    public PageVo<Sysuser> selectUser(){
        int pageNum=1;
        int pageSize=50;
        PageVo<Sysuser> pageVo=new PageVo();
        pageVo.setPageSize(pageSize);
        pageVo.setPage(pageNum);//当前页
        PageHelper.startPage(pageNum, pageSize);
        Sysuser user=new Sysuser();
        user.setStatus(1);
        List list= sysuserMapper.selectUserList(user);
        pageVo.setData(list);
        return  pageVo;
    }

}
